package com.book.system.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.book.common.annotation.group.InsertGroup;
import com.book.common.core.domain.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

import javax.validation.constraints.NotBlank;
import java.util.Date;

/**
 * @author Bigboss
 * @create 2024-11-10 17:03
 */
@ApiModel(description = "用户完成任务信息记录表")
@TableName("user_task_completion")
public class UserTaskCompletion extends BaseEntity {

    /**
     * 记录id
     */
    @ApiModelProperty(value = "记录id")
    @TableId(value = "id",type = IdType.ASSIGN_ID)
    private String id;


    /**
     * 用户id
     */
    @ApiModelProperty(value = "用户id")
    private String appUserId;


    /**
     * 任务id
     */
    @NotBlank(message = "请选择对应的任务",groups = {InsertGroup.class})
    private String taskId;


    /**
     * 任务完成日期
     */
    private Date completionDate;


    /**
     * 奖励
     */
    private Integer rewardEarned;


    /**
     * 对应的任务信息
     */
    @TableField(exist = false)
    private Task task;

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getAppUserId() {
        return appUserId;
    }

    public void setAppUserId(String appUserId) {
        this.appUserId = appUserId;
    }

    public String getTaskId() {
        return taskId;
    }

    public void setTaskId(String taskId) {
        this.taskId = taskId;
    }

    public Date getCompletionDate() {
        return completionDate;
    }

    public void setCompletionDate(Date completionDate) {
        this.completionDate = completionDate;
    }

    public Integer getRewardEarned() {
        return rewardEarned;
    }

    public void setRewardEarned(Integer rewardEarned) {
        this.rewardEarned = rewardEarned;
    }

    public Task getTask() {
        return task;
    }

    public void setTask(Task task) {
        this.task = task;
    }

    @Override
    public String toString() {
        return "UserTaskCompletion{" +
                "id='" + id + '\'' +
                ", appUserId='" + appUserId + '\'' +
                ", taskId='" + taskId + '\'' +
                ", completionDate=" + completionDate +
                ", rewardEarned=" + rewardEarned +
                '}';
    }
}
